// JScript File

//##    Ajax (yang)
var xmlhttp;

function GetXmlResponse(url)
{
	var out = "";
    this.xmlhttp = CreateXmlHttpRequest();
    
    if(xmlhttp != null)
    {
        ////xmlhttp.onreadystatechange = doContents;
        xmlhttp.open("GET",url,false);
        xmlhttp.send(null);
        out = xmlhttp.responseText;
        //alert("out  " + out);
    }
    
    return out;
}
function CreateXmlHttpRequest()
{
    try
    {
        if( window.XMLHttpRequest )
        {
            xmlhttp_request = new XMLHttpRequest();
            if (xmlhttp_request.overrideMimeType) 
            {
                xmlhttp_request.overrideMimeType('text/xml');
            }
        }
        else if( window.ActiveXObject )
        {
            for( var i = 5; i; i-- )
            {
                try
                { 
                    if( i == 2 )
                    { 
                        xmlhttp_request = new ActiveXObject( "Microsoft.XMLHTTP" );
                    }else{
                        xmlhttp_request = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" );
                    }
                    
                    break;
                }
                catch(e)
                {
                    xmlhttp_request = null;
                }
            }
        }
    }
    catch(e)
    {
        xmlhttp_request = null;
    }
    
    return xmlhttp_request;
}
function doContents()
{
    if (xmlhttp.readyState == 4) 
    {
        if (xmlhttp.status == 200)
        {
            //alert(xmlhttp.responseText);
        } 
        else
        {
            //alert(xmlhttp.status);
        }
    }
}
//String.prototype.UrlEncode = function()
//{
//    var str = this;
//    str = str.replace(/./g,function(sHex)
//    {
//        window.EnCodeStr = "";
//        window.sHex = sHex;
//        window.execScript('window.EnCodeStr=Hex(Asc(window.sHex))',"vbscript");
//        return window.EnCodeStr.replace(/../g,"%$&");
//    });
//    return str;
//}